package com.xm.email.core;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.sun.mail.util.MailSSLSocketFactory;
import lombok.*;
import lombok.extern.slf4j.Slf4j;

import java.io.File;
import java.security.GeneralSecurityException;
import java.util.List;
import java.util.Properties;

@Data
@ToString
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Slf4j
public class MailInfo {
    //发送邮件的服务器的IP和端口
    private String mailServerHost;
    private String mailServerPort = "25";
    //邮件发送者的地址
    private String fromAddress;
    //邮件接收者的地址
    private String toAddress;
    //登陆邮件发送服务器的用户名和密码
    private String userName;
    private String password;
    //是否需要身份验证
    private boolean validate = false;
    //开启ssl
    private boolean ssl = false;
    //邮件主题
    private String subject;
    //邮件的文本内容
    private String content;
    //邮件附件上传路径
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private List<String> fileList;
    //邮件附件
    private List<File> files;
    //邮件内容是否属于文本
    private boolean isHtml;
}